// 0.导入axios实例对象用于发送网络请求
import request from '@/utils/request'
// 0.导入store用户获取vuex中的数据
import store from '@/store'

// 1. 调获取验证码的接口的函数
export const sendSms = mobile => {
  return request({
    method: 'GET',
    url: `/v1_0/sms/codes/${mobile}`
  })
}

// 2. 调用登录接口的函数
export const login = data => {
  return request({
    method: 'POST',
    url: '/v1_0/authorizations',
    data
  })
}

// 3. 调用获取用户信息接口的函数
export const getUserInfo = () => request({
  method: 'GET',
  url: '/v1_0/user'
  // headers: {
  //   Authorization: `Bearer ${store.state.user.token}`
  // }
})
